import Vue from 'vue'
import App from './App.vue'
// 引入router store 
import router from './router'
import store from './store'
// 引入element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
// 引入axios
import axios from 'axios'
// 引入操作cookies的插件
import VueCookies from "vue-cookies"
// 引入图片缩放组件
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
import vueEsign from 'vue-esign'
import VForm from 'vform-builds'  //引入VForm库
import 'vform-builds/dist/VFormDesigner.css'  //引入VForm样式

Vue.use(vueEsign)
Vue.prototype.$cookie = VueCookies//创建本地cookie
Vue.use(Viewer)
// Vue.use(VueCookies)
Vue.use(ElementUI)
Vue.use(VForm)
axios.defaults.baseURL = 'http://gyt2bs.natappfree.cc/'
// axios挂载到原型上
Vue.prototype.$http = axios

Vue.config.productionTip = false

// 响应拦截器
axios.interceptors.response.use(function (response) {
  // Do something with response data
  // if (response.headers['Authorization']) {  //获取响应头里面的数据，**Authorization根据你响应头里面的数据获取，并不是唯一值**
  //   console.log(111,response.headers['Authorization'].split(';')[1].split('=')[1])
  //   downLoad(response.data, response.headers['Authorization'].split(';')[1].split('=')[1]);
  // }
  // response['Access-Control-Expose-Headers'] = 'Set-Cookie'
  console.log(222, response);
  return response;
}, function (error) {
  // Do something with response error
  return Promise.reject(error);
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
